package com.lagou.service2.impl;


import com.lagou.api.HelloService;

import java.util.concurrent.TimeUnit;


public class HumanServiceImpl implements HelloService {

    /////////////////////////// 作业1 ///////////////////////////////////
    @Override
    public String sayHello(String name) {
        return "服务2:" + name;
    }

    @Override
    public String fn1(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep((int) (Math.random() * 100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "服务2-fn1: " + name;
    }

    /////////////////////////// 作业2 ///////////////////////////////////
    @Override
    public String fn2(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep((int) (Math.random() * 100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "服务2-fn2: " + name;
    }

    @Override
    public String fn3(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep((int) (Math.random() * 100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "服务2-fn3: " + name;
    }
}